package com.shilei;

import com.shilei.common.ResourceMgr;

import java.awt.*;

/**
 * @description: 墙
 * @author: 81271
 * @date: 2020-04-16 20:11
 */
public class Wall extends GameObject{


    public static int HEIGHT = ResourceMgr.wall.getHeight();
    public static int WIDTH = ResourceMgr.wall.getWidth();

    private Rectangle rect = new Rectangle();

    public Wall(int x, int y) {
        this.x = x;
        this.y = y;

        rect.x = this.x;
        rect.y = this.y;
        rect.width = WIDTH;
        rect.height = HEIGHT;

        GameModel.getInstance().gameObjectList.add(this);
    }

    @Override
    public void paint(Graphics g) {
        g.drawImage(ResourceMgr.wall, x, y, null);
    }

    public Rectangle getRect() {
        return rect;
    }

    @Override
    public int getHeight() {
        return HEIGHT;
    }

    @Override
    public int getWidth() {
        return WIDTH;
    }

}
